package com.recommender.utils;

import com.recommender.service.MovieInfoServiceImpl;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;


public class PageInfo {
    public int pageNum;
    public int pageCapbility;
    private int count;

    public PageInfo(int pageNum, int pageCapbility, int count){
        this.pageNum=pageNum;
        this.pageCapbility=pageCapbility;
        this.count=count;
    }
    public boolean hasNext(){
        return pageNum<this.getTotalPage();
    }

    public int getTotalPage(){
        int totalPage = count % pageCapbility == 0 ? count / pageCapbility : (count / pageCapbility + 1);
        return totalPage;
    }
}
